package com.gordon.wiki.controller;

import com.gordon.wiki.resp.StatisticResp;
import com.gordon.wiki.result.Result;
import com.gordon.wiki.result.ResultUtil;
import com.gordon.wiki.service.EbookSnapshotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Projectname: wiki
 * @Filename: EbookSnapshotController
 * @Author: GordonLo
 * @Data:2022/11/23 9:45
 * @Description: TODO
 */

@RestController
@RequestMapping("/ebook-snapshot")
public class EbookSnapshotController {

    @Autowired
    private EbookSnapshotService ebookSnapshotService;

    @GetMapping("/getStatistic")
    public Result getStatistic() {
        List<StatisticResp> statistic = ebookSnapshotService.getStatistic();
        return ResultUtil.success(statistic);
    }


    @GetMapping("/get30Statistic")
    public Result get30Statistic() {
        List<StatisticResp> statistic = ebookSnapshotService.get30Statistic();
        return ResultUtil.success(statistic);
    }

}
